package com.example.bjsfpost.domain;

import lombok.Data;

import java.io.Serializable;

@Data
public class NormalResponseDO implements Serializable {

    private static final long serialVersionUID = 1L;
    private Boolean success;
    private String code;
    private Object data;

    public static NormalResponseDO ok(Object data){
        NormalResponseDO result = new NormalResponseDO();
        result.setData(data);
        result.setCode("200");
        result.setSuccess(true);
        return result;
    }
    public static NormalResponseDO fail(Object data){
        NormalResponseDO result = new NormalResponseDO();
        result.setData(data);
        result.setCode("-1");
        result.setSuccess(false);
        return result;
    }
}